﻿using BCCommon;
using BCCommon.Enums;
using System.ComponentModel.DataAnnotations;

namespace BCDto.Common.GenerateReceivingCode
{
    /// <summary>
    /// 表示生成收货码的请求对象。
    /// </summary>
    public class GenerateReceivingCodeRequestDto
    {
        /// <summary>
        /// 手机号码。
        /// </summary>
        [Display(Name = "手机号码")]
        [Required(ErrorMessage = "{0} 不能为空")]
        [StringLength(11, ErrorMessage = "{0} 长度为 {1} 个数字", MinimumLength = 11)]
        [RegularExpression(RegexPatterns.PHONE, ErrorMessage = "{0} 格式不正确")]
        public string Phone { get; set; }

        /// <summary>
        /// 选项。
        /// </summary>
        [Display(Name = "选项")]
        [Required(ErrorMessage = "{0} 不能为空")]
        public PassCodeGenerateOptions Options { get; set; }
    }
}
